home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 4 / boot-disc-1996-12.iso / Apps / Cakewalk / PROAUD5 / AD.1 / Split Channel to Tracks.cal < prev    next >
Text File  |  1996-06-18  |  1KB  |  49 lines

  1. ;
  2. ; Split Channel to Tracks.cal
  3. ;
  4. ; This takes the current track and splits it by channel into 16 other tracks.
  5. ; It is up to the user to:
  6. ;    - position the cursor on the desired track to be split
  7. ;    - make sure only that track is selected
  8. ;    - set From and Thru to cover whatever portion of it they wish split
  9. ;
  10.  
  11. (do
  12.     (include "need20.cal")    ; Require version 2.0 or higher of CAL
  13.  
  14.     (int nTrk 1)
  15.  
  16.     (getInt nTrk "First destination track?" 1 256)
  17.     (-- nTrk)    ; CAL uses 0..255
  18.  
  19.     (int nChannel 0)
  20.  
  21.     (while (< nChannel 16)
  22.         (do
  23.             ; Provide some progress information on the message line
  24.             (message "Channel " (+ 1 nChannel) " --> Track " (+ 1 nTrk))
  25.  
  26.             ; Set the event filter 0 to include everything
  27.             (ResetFilter 0 1)
  28.             ; Restrict item 10, Channel, to be in the range nChannel..nChannel
  29.             (SetFilterRange 0 10 TRUE nChannel nChannel)
  30.             ; Now use that to cut the events meeting the criteria
  31.             (EditCut From Thru TRUE TRUE FALSE FALSE FALSE FALSE)
  32.             ; Paste them to the destination track, nTrk
  33.             (EditPasteToTrack From TRUE FALSE TRUE FALSE FALSE FALSE nTrk)
  34.  
  35.             ; Give track an informative name
  36.             (TrackName (format "Split Chan " (+ 1 nChannel)) nTrk)
  37.             ; Set the forced channel, although that's redundant because all the events
  38.             ; in the track have that channel
  39.             (TrackChannel nChannel nTrk)
  40.             ; Un-mute the track
  41.             (TrackActive TRUE nTrk)
  42.  
  43.             (++ nChannel)
  44.             (++ nTrk)
  45.         )
  46.     )
  47. )
  48.  
  49.